package qqgroupdata.process.common;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;

@ControllerAdvice
@ResponseBody
@Slf4j
public class WebExceptionHandle {

    @ExceptionHandler(Throwable.class)
    public Object throwable(Throwable e) {
        log.error("查询错误！", e);
        return JsonResult.success("查询错误，可能是号码太长",new ArrayList<>());
    }
}
